
begintalkscript;
variables;

begintalknode 1;
	state = -1;
	nextstate = 2;
	question = "Graybeard";
	text1 = "The old ogre stands stooped, with nothing to support him, yet he does not sway an inch. Both his beard and hair are white as snow. Beard and bushy eyebrows frame its dark brown eyes which burn with the bright flame of intelligence.";
	text2 = "It raises its hands, palms open, to the level of his elbows, but motions no further. _Human,_ you can tell from this one word already that this ogre is not like the rest of his species when it comes to words. He wields them proficiently.";
	text3 = "_I am Graybeard. I mean you no harm. I only want to talk._ It lowers one of its hands and brushes the cloak it has wrapped around its body. You sense a faint magical residue from the cloak.";
	text5 = "Graybeard looks at you with sorrowful eyes. _What do you want, human?_";
	action = INTRO;

begintalknode 2;
	state = 2;
	nextstate = 3;
	condition = get_flag(2,8) == 0 && get_flag(6,5) == 0;
	question = "Who are you, Graybeard?";
	text1 = "Graybeard's big eyes fill with sadness. _I was the chief of this tribe. I was their protector. I failed. Look at my tribe now; beaten, slaughtered, driven away like animals. I could not prevent it. I could not save them from themselves._";

begintalknode 3;
	state = 2;
	nextstate = 4;
	condition = get_flag(2,8) == 1 && get_flag(6,5) == 0;
	question = "You're Graybeard? Wise Graybeard?";
	text1 = "Graybeard nods, but dolefully. _That is what the ogres called me. When I was chief. Before the Witch came to our lands. Perhaps Ragehound called me that? He told me how you freed him. I thank you for that._";
	text2 = "_The stories of our wizards and chroniclers make no mention of human helping ogre. For your actions I am not afraid to speak to you. Unlike when I speak to my people. Then I am afraid._";

begintalknode 4;
	state = 4;
	nextstate = 6;
	question = "I've heard about this 'witch' but I'd like to learn more.";
	text1 = "_The witch is a human, a female I think. She came to our lands many cycles ago. She brought with her anger, her anger. I do not understand why, but she hates her own people. She wants the human race to die._";
	text2 = "_That is why she provoked the ogre people to attack the humans in the lowlands. She hopes that we will kill all humans, especially those in the town. She hates them especially. She is a great mage, far greater than the three Great Wizards._";
	text3 = "_That is why Angerfist believes we will smite the entire human race._ Graybeard lets out a deep sigh. _But I know better. There are too many humans. They have magi more powerful than the Witch. We lose. We die._";
	text4 = "The old ogre looks at you imploringly. _Unless something is done._";

begintalknode 5;
	state = 4;
	nextstate = -1;
	question = "You were chief before Angerfist? Why did you step down?";
	text1 = "_I did not do it willingly. Angerfist and the three Great Wizards demanded that I step down. They judged my way as old, fearful. They raised Angerfist to lead us. He takes advantage of the nature of the ogres._ ";
	text2 = "_It includes anger. But our anger is special. As long as I can remember our tribe has hated and feared the lowland humans. We have our reasons. Our tribe, the Quarhag tribe, lived on the lowlands once. The humans drove us away._";
	text3 = "_No-one but the chief and wizards remember this and no-one remembers the name of our tribe. It has become trivial. The Witch too knows how to take advantage of our anger. She too feels anger._";

begintalknode 6;
	state = 4;
	nextstate = 5;
	condition = get_flag(2,8) == 1;
	question = "Hold on! I rescued an ogre called Chainhound. Who's Ragehound?";
	text1 = "_Ragehound was Chainhound. When he was freed, he was no longer Chainhound which is why his name changed. You are confused? This is not how human names work? An ogre chooses his name himself. Let's consider Ragehound._ ";
	text2 = "Tomorrow, if he is sad, perhaps he will name himself Sorrowhound. Thus have the mountain ogres always done. Our tribe also decides an additional name for their chief. That is why I was WISE Graybeard._";
	text3 = "_But now Angerfist names me Fool Graybeard and maybe that is the name I will die with. When I die I will not be entombed with other chiefs. They will eat my body._";

begintalknode 7;
	state = 5;
	nextstate = 4;
	question = "But Angerfist is just Angerfist?";
	text1 = "_Angerfist has always been Angerfist. He was born angry when he punched his way out of his mother's womb. She died shortly after his birth. Angerfist remained angry through his infancy and childhood. He has always been angry._";
	text2 = "_It is a defect in his soul. He cannot feel but anger. I fear there will be no peaceful resolution for him in this battle. I fear he will die. But more than that I fear our entire tribe will die._";

begintalknode 8;
	state = 6;
	nextstate = 7;
	question = "What could be done?";
	text1 = "_You could kill the Witch. If she is removed then perhaps the ogre people will lose their resolve; then perhaps Angerfist will lose his power. Maybe Angerfist need not die. Sadly, I do not believe this can happen._";
	text2 = "_His anger will not die. But I do hope that if the Witch is removed then the ogre people will not want to fight anymore. Then maybe we can hide again. Then maybe humans will forget about us again. Maybe we can live._";

begintalknode 9;
	state = 7;
	nextstate = 2;
	condition = get_flag(84,14) == 0;
	question = "Very well. I will face this 'Witch' for you and try to get rid of her.";
	text1 = "_I am glad and I hope you will be able to kill the Witch. She does not live in these caves, but we do have a way to get to her. There is a portal at the end of the caves, behind the sacred meditation cave._";
	text2 = "_The Witch herself set it up with the help of our magi. I have not stepped through the portal, but I have seen Angerfist do it; and the Witch. Maybe she can be reasoned with._";
	text3 = "_I doubt it. She is full of anger._";
	code =
		toggle_quest(3,1);
		set_flag(84,14,1);
	break;
begintalknode 10;
	state = 7;
	nextstate = 2;
	condition = get_flag(84,14) == 0;
	question = "I'm here to kill Angerfist. Maybe I'll deal with this witch if I run into her. We'll see.";
	text1 = "_Then I am saddened. I had hoped that Angerfist need not die, but I always feared that would not be possible. Maybe his anger must eat him whole. There is no peaceful ending for him, maybe no peaceful ending for the ogre people._";
	text2 = "_But I ask you, do not go through these doors!_ The ancient ogre points at the double doors behind him. _The ogres hiding there do not want to fight. They are scared. They reject Angerfist. They reject the Witch._";
	text3 = "_The Witch hides beyond a portal located in the back of the meditation chamber. There you will find Angerfist and I hope you will change your mind and step through the portal to deal with the Witch._";

begintalknode 11;
	state = 2;
	nextstate = -1;
	condition = get_flag(6,5) == 0 && get_flag(84,14) == 0;
	question = "Die monster!";
	text1 = "You take a swing at the old ogre with your blade, but even through the ogre is old it is not slow. It dodges your first swing and takes up a fighting stance.";
	action = END_TALK;
	code =
		set_attitude(20,10);
	break;
begintalknode 12;
	state = 2;
	nextstate = -1;
	condition = get_flag(6,5) == 1;
	question = "Aprillia, I mean, the Witch is dead.";
	text1 = "_Yes, and so is Angerfist._ Graybeard bobs his head sadly. _I am glad. But I mourn for the ogres who lost their lives. Our numbers have become much smaller because of Angerfist and the Witch. Now the ogre people must hide._";
	text2 = "_I ask one more thing of you; do not tell the lowland humans about us; the ogres who still live. I fear the humans would kill us if they knew we were still here._ Graybeard takes off his cloak. _Take this. It is the cloak of the chieftain._";
	text3 = "_May it guide you into wise decisions as it has helped me in past cycles._ The ogre chief solemnly nods before he leaves the cave through the double doors in the west.";
	action = END_TALK;
	code =
		award_party_xp(100,15);
		toggle_quest(3,0);
		reward_give(450);
		relocate_character(20,13,8);
		set_flag(5,14,1);
	break;
begintalknode 13;
	state = 3;
	nextstate = 4;
	question = "How did you fail?";
	text1 = "_I could not contain the anger of the ogre people. We have always been quick to give in to our anger and squash everything smaller that annoys us. For many cycles the ogre people were in hiding. We did not see any humans._";
	text2 = "_But there were some ogres who hated the humans more and wanted to attack and kill the lowland humans. Angerfist was one of these ogres. He was the loudest of these ogres. But I had the support of the Three Great Wizards._";
	text3 = "_So I remained chief. That changed when the Witch came. That changed when anger took control of my people._";

begintalknode 14;
	state = 2;
	nextstate = -1;
	question = "Goodbye";
	text1 = "You leave Graybeard.";
	action = END_TALK;

begintalknode 15;
	state = 6;
	nextstate = -1;
	question = "I will do nothing for you, but I will do this to you! (Attack.)";
	text1 = "You take a swing at the old ogre with your blade, but even through the ogre is old it is not slow. It dodges your first swing and takes up a fighting stance.";
	action = END_TALK;
	code =
		set_attitude(20,10);
	break;
begintalknode 16;
	state = -1;
	nextstate = 17;
	question = "Joyhound";
	text1 = "_You kill Angerfist!_ The ogre repeats with elation. _I Joyhound. I very happy!_ Joyhound's grin abruptly fades away. _Wise Graybeard send message! Many ogre come to village. They guard pass before._";
	text2 = "_They want kill you. Maybe in caves now! Much anger!_";
	text3 = "_You kill Angerfist!_ The ogre repeats with elation. _I Joyhound. I very happy!_ The ogre laughs gleefully. _Now you talk to Graybeard! He want talk! Give reward._ The ogre turns around and hurries off with a _Me go!_";
	code =
		if (get_flag(152,7) == 0)
			remove_string(3);
		
		if (get_flag(152,7) == 1) {
			remove_string(1);
			remove_string(2);
			erase_char(35);
			end();
		}
	break;
begintalknode 17;
	state = 17;
	nextstate = -1;
	question = "How many ogres are there exactly?";
	text1 = "_Uh?_ Joyhound looks at his fingers in confusion. He squeezes the hand into a fist and opens it again. _Not know, more._ The hand drops. _Now must go. Other ogres must not see talk._";
	text2 = "Joyhound quickly limps away from sight.";
	action = END_TALK;
	code =
		erase_char(35);
	break;
begintalknode 18;
	state = 17;
	nextstate = -1;
	question = "Oh, so now your name is Joyhound?";
	text1 = "_Yah! Joyhound very happy! That is why Joyhound! No more chains, no more rage! Only joy now! That is good._";

begintalknode 19;
	state = 5;
	nextstate = -1;
	question = "Eat your body? You cannibalize your dead?";
	text1 = "_Cannibalize?_ The ogre savors the word, obviously not knowing what it means. So you explain it to him. _But that is the way of nature. The dead provide a meal for the living. It would serve no purpose to keep all the bodies._";
	text2 = "_Our tribe has forever eaten those they feel did not deserve a burial. They did not deserve shrine. Our chiefs have always been enshrined, but Angerfist might make an exception out of me. He would not allow my body to be kept.";
	text3 = "_We also make exceptions for great warriors. In battle the warriors eat all the fallen, but not those who fought well. They are brought to their families who may enshrine them, or eat them if they wish._";
	text5 = "Well, that would explain the lack of bodies in the Yelbro trade post.";

begintalknode 20;
	state = 2;
	nextstate = -1;
	condition = get_flag(6,5) == 5;
	question = "I think I saw the Witch. She escaped.";
	text1 = "You retell your brief encounter with the human sorceress. Graybeard's huge face fills with sorrow. _Then she succeeded. She destroyed the lowland humans. Who will be blamed? The ogres._";
	text2 = "_Now I must lead my people away. We hide like our ancestors so many cycles before. I thank you for trying to help us, but it was not enough._ Graybeard sighs solemnly, turns around and leaves.";
	action = END_TALK;
	code =
		toggle_quest(3,0);
		relocate_character(20,13,8);
		set_flag(5,14,1);
	break;
begintalknode 21;
	state = 2;
	nextstate = -1;
	condition = get_flag(84,14) == 1;
	question = "Are there any other ogres who do not want to fight me?";
	text1 = "_In these caverns? Only behind these doors._ Graybeard points at the double doors behind him. _I ask you not to disturb them. They fear all humans and would panic if they saw you._";
	text2 = "_The other ogres in these caverns are loyal to Angerfist. They will fight you. They will enjoy it. Lord of Flies is also in these caves. Beware him! He is a strong mage._";
